Box FloatError::DecimalFloat to shrink the error enum#229
Conversation
DecimalFloatErrors is 104 bytes, making FloatError 112 bytes and tripping clippy::result_large_err in downstream consumers (e.g. raindex) whose aggregate error enums embed FloatError. Boxing the variant drops FloatError to ~64 bytes; consumers' match/Display are unaffected. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
|
Warning Review limit reached
More reviews will be available in 19 minutes and 8 seconds. Learn how PR review limits work. Your organization has run out of usage credits. Purchase more in the billing tab. ⌛ How to resolve this issue?After more reviews become available, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans include higher PR review limits than trial, open-source, and free plans. In all cases, reviews become available again over time. During sustained high-volume PR review activity, CodeRabbit may temporarily slow when the next review becomes available. Please see our Fair Usage Limits Policy for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Pro Run ID: 📒 Files selected for processing (1)
WalkthroughThe PR boxes the ChangesBox DecimalFloatErrors in FloatError variant
🎯 1 (Trivial) | ⏱️ ~3 minutes 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@crates/float/src/error.rs`:
- Line 24: The pattern matches for FloatError::DecimalFloat must be updated to
account for the Box payload: wherever code currently matches
FloatError::DecimalFloat(DecimalFloatErrors::X(...)) (e.g., the matches! uses in
lib.rs around the noted sites), change the pattern to bind the box
(FloatError::DecimalFloat(inner)) and then match the boxed value in a guard or
inner match (for example use a guard like `if matches!(*inner,
DecimalFloatErrors::Variant(_))` or an inner `match *inner { ... }`) so you
destructure through the Box and correctly detect DecimalFloatErrors variants;
update all occurrences referencing FloatError::DecimalFloat and
DecimalFloatErrors accordingly.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: ASSERTIVE
Plan: Pro
Run ID: 31701bf9-2576-4043-9b3f-75ca07bd2e9b
📒 Files selected for processing (2)
crates/float/src/error.rscrates/float/src/evm.rs
Boxing FloatError::DecimalFloat means the inner DecimalFloatErrors is behind a Box; update the assert!(matches!(...)) sites to match the variant and deref in a guard. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
|
@coderabbitai assess this PR size classification for the totality of the PR with the following criterias and report it in your comment: S/M/L PR Classification Guidelines:This guide helps classify merged pull requests by effort and complexity rather than just line count. The goal is to assess the difficulty and scope of changes after they have been completed. Small (S)Characteristics:
Review Effort: Would have taken 5-10 minutes Examples:
Medium (M)Characteristics:
Review Effort: Would have taken 15-30 minutes Examples:
Large (L)Characteristics:
Review Effort: Would have taken 45+ minutes Examples:
Additional Factors to ConsiderWhen deciding between sizes, also consider:
Notes:
|
|
Tip For best results, initiate chat on the files or code changes. SIZE=S |
Summary
DecimalFloatErrorsis 104 bytes, makingFloatError112 bytes.clippy::result_large_errin downstream consumers (e.g. raindex) whose aggregate error enums embedFloatError— once embedded, their enums exceed the 128-byte threshold.DecimalFloatvariant dropsFloatErrorto ~64 bytes. Consumers'match/Displayare unaffected (deref throughBox).Test plan
Summary by CodeRabbit